Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IT FIM- Refactor Registry file limit tests #2478

Merged
merged 9 commits into from
Mar 7, 2022

Conversation

Deblintrake09
Copy link
Contributor

@Deblintrake09 Deblintrake09 commented Jan 25, 2022

Related issue
#2353

Description

In this PR the following changes were made:

  • Refactor test_registry_file_limit folder to new Standard
  • Blocked test_registry_limit_values.py because of wazuh/wazuh issue #11819
  • Refactor some of the tests in test_registry_report_changes removed
  • Removed Time Travel from all tes_registry_report_changes tests that were refactored
  • Improved Times on tests without time travel by 20-33%
  • Created new test test_registry_disk_quota_bigger_file_limit
  • Skipped test_report_changes_after_restart because of flaky behaviour in Jenkins. Added to Issue [#2174]

Configuration options

Windows Agent Package: 4.3.0-1

Local Internal Options

syscheck.debug=2
windows.debug=2
agent.debug=2
monitord.rotate_log=0

Tests

Type Jenkins Local Results Date By Notest
Windows 🟢 🟢 2022/02/02 @Deblintrake09
Windows 🟢 🟢 2022/02/02 @Deblintrake09
Windows 🟢 🟢 2022/02/02 @Deblintrake09
Linux 🟢 🟢 2022/02/02 @Deblintrake09
Linux 🟢 🟢 2022/02/02 @Deblintrake09
Linux 🟢 🟢 2022/02/02 @Deblintrake09
Manager 🟢 🟢 2022/02/02 @Deblintrake09
Manager 🟢 🟢 2022/02/02 @Deblintrake09
Manager 🟢 🟢 2022/02/02 @Deblintrake09
  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.
  • Python codebase is documented following the Google Style for Python docstrings.
  • The test is documented in wazuh-qa/docs.

@Deblintrake09 Deblintrake09 changed the title 2353 Refactor Registry file limit tests IT - Refactor Registry file limit tests Jan 25, 2022
@Deblintrake09 Deblintrake09 linked an issue Jan 25, 2022 that may be closed by this pull request
deps/wazuh_testing/wazuh_testing/tools/file.py Outdated Show resolved Hide resolved
assert database_state == '100', 'Wrong value for full database alert.'
else:
pytest.fail('Did not receive the value of the database state,')
assert database_state == '100', ERR_MSG_WRONG_VALUE_FOR_DATABASE_FULL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, Could you change the 'ossec.log' name in the documentation, please?? You could change it by the wazuh logs, or something like that.
Because on 5.0 the ossec.log wil change to wazuh.log

Copy link
Contributor

@CamiRomero CamiRomero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ! but some changes are required

test_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
wazuh_log_monitor = FileMonitor(LOG_FILE_PATH)
reg1, reg2 = test_regs
size_limit_configured = 10 * 1024
size_limit_configured = SIZE_LIMIT_CONFIGURED_VALUE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use directly SIZE_LIMIT_CONFIGURED_VALUE instead of defining a new variable size_limit_configured

@CamiRomero
Copy link
Contributor

CamiRomero commented Feb 2, 2022

Test path Execution OS Type Version Date Status Executed by Note
test_fim/ Jenkins Windows Agent 4.3.0 01/02/2022 🔴 Camila Two test fails. Test: test_basic_usage_registry_baseline_generation.py
test_fim/ Jenkins Windows Agent 4.3.0 01/02/2022 🔴 Camila One test fail. Test : test_registry_report_changes_deleted.py
test_fim/ Jenkins Windows Agent 4.3.0 01/02/2022 🔴 Camila One test fail. Test: test_registry_report_changes_deleted.py
Test path Execution OS Type Version Date Status Executed by Note
test_fim/ Jenkins MacOS Agent 4.3.0 01/02/2022 🔴 Camila One test fail. Test: test_basic_usage_realtime_unsupported.py
test_fim/ Jenkins MacOS Agent 4.3.0 01/02/2022 🟢 Camila
test_fim/ Jenkins MacOS Agent 4.3.0 01/02/2022 🟢 Camila
Test path Execution OS Type Version Date Status Executed by
test_fim/ Jenkins Centos Agent 4.3.0 01/02/2022 🟢 Camila
test_fim/ Jenkins Centos Agent 4.3.0 01/02/2022 🟢 Camila
test_fim/ Jenkins Centos Agent 4.3.0 01/02/2022 🔵 Camila
Test path Execution OS Type Version Date Status Executed by
test_fim/ Jenkins Centos Manager 4.3.0 01/02/2022 🟢 Camila
test_fim/ Jenkins Centos Manager 4.3.0 01/02/2022 🟢 Camila
test_fim/ Jenkins Centos Manager 4.3.0 01/02/2022 🟢 Camila
Test path Execution OS Type Version Date Status Executed by
test_fim/ Jenkins Solaris Agente 4.3.0 02/02/2022 🟢 Camila
test_fim/ Jenkins Solaris Agente 4.3.0 02/02/2022 🟢 Camila
test_fim/ Jenkins Solaris Agente 4.3.0 02/02/2022 🟢 Camila

Comment on lines 6 to 8
- MODULE_NAME
- test_registry_limit_capacity_alerts
- test_registry_limit_full
- test_registry_limit_values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change it?

Comment on lines 47 to 48
realtime: Enable real-time monitoring on Linux (using the 'inotify' system calls) and Windows systems.
whodata: Implies real-time monitoring but adding the 'who-data' information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you delete these? Is it not working with real-time mode and whodata mode?

Comment on lines 107 to 108

@pytest.mark.parametrize("size", [(8192), (32768)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining what these numbers mean. We know it, but this test must be clear to external teams.

@pytest.mark.parametrize('size', [
(4 * 1024),
(16 * 1024),
@pytest.mark.parametrize('size', [(4096), (16384)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining what these numbers mean. We know it, but this test must be clear to external teams.

@damarisg damarisg changed the title IT - Refactor Registry file limit tests IT FIM- Refactor Registry file limit tests Feb 9, 2022
damarisg
damarisg previously approved these changes Feb 10, 2022
Copy link
Member

@damarisg damarisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type Test Path Jenkins Date By
Windows test_fim/ 🟢 🟢 🟢 2022/02/10 Seyla
Linux Agent test_fim/ 🟢 🟢 🟢 2022/02/10 Seyla
Manager test_fim/ 🟢 🟢 🟢 2022/02/10 Seyla

Well done!

@Deblintrake09
Copy link
Contributor Author

Deblintrake09 commented Feb 14, 2022

Type Test Path Date By
Windows test_fim/ 🟢 2022/02/14 @Deblintrake09
Linux Agent test_fim/ 🟢 2022/02/14 @Deblintrake09
Manager test_fim/ 🟢 2022/02/14 @Deblintrake09

@CamiRomero
Copy link
Contributor

Type Test Path Jenkins Date By
Windows test_fim/ 🟢 🟢 🟢 22/02/2022 @CamiRomero
Linux Agent test_fim/ 🟢 🟢 🟢 22/02/2022 @CamiRomero
Manager test_fim/ 🟢 🟢 🟢 22/02/2022 @CamiRomero

@snaow snaow merged commit ab0951c into master Mar 7, 2022
@snaow snaow deleted the 2353-refactor-registry-file-limit branch March 7, 2022 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IT FIM: Refactor 'test_registry' according to new standard (4)
4 participants